// KeyPhraseCollection.h: interface for the KeyPhraseCollection class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_KEYPHRASECOLLECTION_H__C771212D_9049_4BAE_871A_14841B24396A__INCLUDED_)
#define AFX_KEYPHRASECOLLECTION_H__C771212D_9049_4BAE_871A_14841B24396A__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include <map>
#include <string>
#include <fstream>

using namespace std;

#include "ExtractorApi.h"

class KeyPhraseItem{

private:

	long Index;
	int Frequency;
	

public:

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

	KeyPhraseItem():Index(0) , Frequency(1){};
	KeyPhraseItem( int LcIndex ): Index( LcIndex ) , Frequency(1) {}

//////////////////////////////////////////////////////////////////////
// Gets/Sets
//////////////////////////////////////////////////////////////////////

	int GetIndex(){ return Index; }
	long GetFrequency(){ return Frequency; }
	void SetIndex( long LcIndex ){ Index = LcIndex; }
	void SetFrequency( int LcFrequency ){ Frequency = LcFrequency; }
};//KeyPhraseItem





typedef map< string , KeyPhraseItem> KeyPhraseMap;

class KeyPhraseCollection
{

private:
	
	KeyPhraseMap MyKeyPhrases;

public:
	void ReadKeyPhrasesFromFile( string FilePath);

	KeyPhraseCollection(){};
	virtual ~KeyPhraseCollection(){ MyKeyPhrases.clear(); };
	
	int FindKeyPhraseItem( string ToInKeyPhrase );
	int AddKeyPhraseItem( string ToInKeyPhrase );
	int GetSize(){ return MyKeyPhrases.size(); }
	KeyPhraseMap GetKeyPhraseMap(){return MyKeyPhrases;};
};//KeyPhraseCollection



#endif // !defined(AFX_KEYPHRASECOLLECTION_H__C771212D_9049_4BAE_871A_14841B24396A__INCLUDED_)
